home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 002 / pcspel2.arc / SORTDIC.BAS < prev    next >
BASIC Source File  |  1984-10-25  |  1KB  |  42 lines

  1. 10 ON ERROR GOTO 260
  2. 20 KILL"qwertyui"
  3. 30 NAME "dictiona" AS "qwertyui"
  4. 40 ON ERROR GOTO 280
  5. 50 OPEN "qwertyui" FOR INPUT AS #1
  6. 60 OPEN "update" FOR INPUT AS #2
  7. 70 OPEN "dictiona" FOR OUTPUT AS #3
  8. 80 INPUT #1,DIC$:INPUT #2,M$
  9. 90 REM start main loop
  10. 100 IF M$<DIC$ THEN 190
  11. 110 REM dictionary word is smaller
  12. 120 PRINT #3,DIC$:W=W+1
  13. 130 I=1:PRINT "D";:INPUT #1,DIC$
  14. 140 IF M$>DIC$ THEN 120
  15. 150 PRINT #3,M$:W=W+1
  16. 160 I=2:PRINT "m";:INPUT #2,M$
  17. 170 GOTO 100
  18. 180 REM merge word is smaller
  19. 190 PRINT #3,M$:W=W+1
  20. 200 I=2:INPUT #2,M$:PRINT "M";
  21. 210 IF DIC$>M$ THEN 190
  22. 220 I=1:PRINT "d";:PRINT #3,DIC$:W=W+1
  23. 230 INPUT #1,DIC$
  24. 240 GOTO 100
  25. 250 END
  26. 260 PRINT ERR,ERL:RESUME NEXT
  27. 270 REM end of one of the files
  28. 280 PRINT "finishing ...";:IF I=2 THEN 370
  29. 290 REM dictionary ran out of words
  30. 300 WHILE NOT EOF(2)
  31. 310 PRINT #3,M$:W=W+1
  32. 320 INPUT #2,M$
  33. 330 WEND:RESET
  34. 340 PRINT "the dictionary now consists of";W;"words"
  35. 350 KILL"update":END
  36. 360 REM merge file ran out
  37. 370 WHILE NOT EOF(1)
  38. 380 PRINT #3,DIC$:W=W+1
  39. 390 INPUT #1,DIC$
  40. 400 WEND:RESET
  41. 410 GOTO 340
  42.